/* GUI CONVERTED from lvauprp.p (converter v1.76) Fri Sep  6 03:25:41 2002 */
/* lvauprp.p - Application Usage Profile Information Report                   */
/* Copyright 1986-2002 QAD Inc., Carpinteria, CA, USA.                        */
/* All rights reserved worldwide.  This is an unpublished work.               */
/* $Revision: 1.3 $                                                           */
/* Revision: 1.1        BY: Rajesh Lokre       DATE: 07/26/02  ECO: *P08G*    */
/* $Revision: 1.3 $     BY: Rajesh Lokre       DATE: 09/03/02  ECO: *P0HF*    */
/******************************************************************************/
/* All patch markers and commented out code have been removed from the source */
/* code below. For all future modifications to this file, any code which is   */
/* no longer required should be deleted and no in-line patch markers should   */
/* be added.  The ECO marker should only be included in the Revision History. */
/******************************************************************************/
/*V8:ConvertMode=Report                                                       */

/* DISPLAY TITLE */

/*GUI preprocessor directive settings */
&SCOPED-DEFINE PP_GUI_CONVERT_MODE REPORT

{mfdtitle.i "2+ "}

define variable l_product  like usg_product label "Application" no-undo.
define variable l_product1 like usg_product label "To"          no-undo.
define variable l_date     like usg_date    label "Date"        no-undo.
define variable l_date1    like usg_date    label "To"          no-undo.
define variable l_summary  like mfc_logical
   format "Summary/Detail" label "Summary/Detail" no-undo.
define variable l_audit    as logical             no-undo.

/* Temp table of products for audit */
{lvrpttt.i "new"}


/*GUI preprocessor Frame A define */
&SCOPED-DEFINE PP_FRAME_NAME A

FORM /*GUI*/ 
   
 RECT-FRAME       AT ROW 1 COLUMN 1.25
 RECT-FRAME-LABEL AT ROW 1 COLUMN 3 NO-LABEL VIEW-AS TEXT SIZE-PIXELS 1 BY 1
 SKIP(.1)  /*GUI*/
l_product     colon 20
   l_product1    colon 52
   l_date        colon 20
   l_date1       colon 52
   skip(1)
   l_summary     colon 20
   skip(1)
with frame a side-labels width 80 NO-BOX THREE-D /*GUI*/.

 DEFINE VARIABLE F-a-title AS CHARACTER INITIAL "".
 RECT-FRAME-LABEL:SCREEN-VALUE in frame a = F-a-title.
 RECT-FRAME-LABEL:HIDDEN in frame a = yes.
 RECT-FRAME:HEIGHT-PIXELS in frame a =
  FRAME a:HEIGHT-PIXELS - RECT-FRAME:Y in frame a - 2.
 RECT-FRAME:WIDTH-CHARS IN FRAME a = FRAME a:WIDTH-CHARS - .5.  /*GUI*/

/*GUI preprocessor Frame A undefine */
&UNDEFINE PP_FRAME_NAME



/* SET EXTERNAL LABELS  */
setFrameLabels(frame a:handle).

repeat :

   if l_product1 = hi_char then
      l_product1 = "".

   if l_date = low_date then
     l_date = ?.

   if l_date1 = hi_date then
     l_date1 = ?.

   update
      l_product
      l_product1
      l_date
      l_date1
      l_summary
   with frame a.

   bcdparm = "".
   {mfquoter.i l_product}
   {mfquoter.i l_product1}
   {mfquoter.i l_date}
   {mfquoter.i l_date1}
   {mfquoter.i l_summary}

   if l_product1 = "" then
      l_product1 = hi_char.

   if l_date = ? then
      l_date = low_date.

   if l_date1 = ? then
      l_date1 = hi_date.


   /* OUTPUT DESTINATION SELECTION */
   {gpselout.i &printType = "printer"
               &printWidth = 80
               &pagedFlag = " "
               &stream = " "
               &appendToFile = " "
               &streamedOutputToTerminal = " "
               &withBatchOption = "yes"
               &displayStatementType = 1
               &withCancelMessage = "yes"
               &pageBottomMargin = 6
               &withEmail = "yes"
               &withWinprint = "yes"
               &defineVariables = "yes"}
/*GUI*/ RECT-FRAME:HEIGHT-PIXELS in frame a = FRAME a:HEIGHT-PIXELS - RECT-FRAME:Y in frame a - 2.


   /* Create the temp table of products to display */
   for each usg_det
      where usg_product >= l_product and usg_product <= l_product1
        and usg_date    >= l_date    and usg_date    <= l_date1
        and usg_count <> 0
   no-lock break by usg_product:
      if first-of(usg_product)
      then do:
         create tt_products.
         assign
            t_product = usg_product.
      end.
   end.

   {mfphead.i}

   /* GENERATE REPORT */
   {gprun.i ""lvauprpa.p""
      "(input l_date,
        input l_date1,
        input l_summary,
        input l_audit)"}

   {mfrtrail.i}

end. /* REPEAT */
